﻿using System;
using System.Diagnostics;
using System.Collections.Generic;

namespace 枸杞VBE插件.Properties
{
    // 通过此类可以处理设置类的特定事件:
    //  在更改某个设置的值之前将引发 SettingChanging 事件。
    //  在更改某个设置的值之后将引发 PropertyChanged 事件。
    //  在加载设置值之后将引发 SettingsLoaded 事件。
    //  在保存设置值之前将引发 SettingsSaving 事件。
    internal sealed partial class Settings
    {
        public Settings()
        {
            // // 若要为保存和更改设置添加事件处理程序，请取消注释下列行:
            //
            // this.SettingChanging += this.SettingChangingEventHandler;
            //
            // this.SettingsSaving += this.SettingsSavingEventHandler;
            //
        }

        internal 代码格式化.IndenterSettings GetSettings()
        {
            return new 代码格式化.IndenterSettings(false)
            {
                AlignCommentsWithCode = AlignCommentsWithCode,
                AlignContinuations = AlignContinuations,
                AlignDimColumn = AlignDimColumn,
                AlignDims = AlignDims,
                EndOfLineCommentColumnSpaceAlignment = EndOfLineCommentColumnSpaceAlignment,
                EndOfLineCommentStyle = (代码格式化.EndOfLineCommentStyle)Enum.Parse(typeof(代码格式化.EndOfLineCommentStyle), EndOfLineCommentStyle),
                EmptyLineHandlingMethod = (代码格式化.EmptyLineHandling)Enum.Parse(typeof(代码格式化.EmptyLineHandling), EmptyLineHandlingMethod),
                ForceCompilerDirectivesInColumn1 = ForceCompilerDirectivesInColumn1,
                ForceDebugStatementsInColumn1 = ForceDebugStatementsInColumn1,
                ForceDebugPrintInColumn1 = ForceDebugPrintInColumn1,
                ForceDebugAssertInColumn1 = ForceDebugAssertInColumn1,
                ForceStopInColumn1 = ForceStopInColumn1,
                IgnoreOperatorsInContinuations = IgnoreOperatorsInContinuations,
                IndentCase = IndentCase,
                IndentCompilerDirectives = IndentCompilerDirectives,
                IndentEnumTypeAsProcedure = IndentEnumTypeAsProcedure,
                IndentEntireProcedureBody = IndentEntireProcedureBody,
                IndentFirstCommentBlock = IndentFirstCommentBlock,
                IndentFirstDeclarationBlock = IndentFirstDeclarationBlock,
                IgnoreEmptyLinesInFirstBlocks = IgnoreEmptyLinesInFirstBlocks,
                IndentSpaces = IndentSpaces,
                VerticallySpaceProcedures = VerticallySpaceProcedures,
                LinesBetweenProcedures = LinesBetweenProcedures
            };
        }

        private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e)
        {
            // 在此处添加用于处理 SettingChangingEvent 事件的代码。
        }

        private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e)
        {
            // 在此处添加用于处理 SettingsSaving 事件的代码。
        }
    }
}